home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-01-29 | 2.0 KB | 65 lines | [TEXT/IGR0] |
- | NOTE:
- | As of Igor Pro 3.0, this function is no longer needed and should not be used in new programming.
- | It will not work if the graph contains waves from data folders other than the current data folder.
- | Igor Pro 3.0 added the built-in TraceNameList function. Use TraceNameList to get a list of
- | the traces in the graph. Then use TraceNameToWaveRef to get a wave reference for a particular
- | trace. If necessary, use XWaveRefFromTrace to get the wave supplying the x in an XY pair.
-
- | GraphWaveList(graphNameStr, matchStr, xOnly, yOnly, separatorStr)
- | Returns a string containing a list of waves in the specified graph which fit
- | certain criteria. Use this when you want only x waves or only y waves.
- | If you want all waves, you can use the built-in WaveList function instead.
- | graphNameStr can be the name of a graph or "" for the top graph
- | matchStr is "*" to match any wave or some pattern to match only selected waves
- | pass 1 for xOnly if you want only waves furnishing the x part of an XY pair
- | pass 1 for yOnly if you want only waves furnishing the y part of an XY pair
- | separatorStr is normally ";" or ","
- Function/S GraphWaveList(graphNameStr, matchStr, xOnly, yOnly, separatorStr)
- String graphNameStr
- String matchStr
- Variable xOnly, yOnly
- String separatorStr
-
- String list1, list2, w
- Variable i
- Variable waveTypeCode
-
- if (strlen(graphNameStr) == 0)
- graphNameStr = WinName(0, 1)
- endif
- if (WinType(graphNameStr) != 1)
- return "" | bad graph name
- endif
-
- | Apply matchStr and graphNameStr criteria
- list1 = WaveList(matchStr, separatorStr, "WIN:" + graphNameStr)
-
- | Figure out which type of waves we want
- waveTypeCode = 0
- if (yOnly)
- waveTypeCode = 1
- endif
- if (xOnly)
- waveTypeCode = 2
- endif
- if (waveTypeCode == 0)
- list2 = list1
- else
- | Now apply the xOnly or yOnly criterion
- list2 = ""
- i = 0
- do
- w = WaveName(graphNameStr, i , waveTypeCode)
- if (strlen(w) == 0)
- break | no more waves
- endif
- if (strsearch(list1, w, 0) >= 0)
- list2 += w + separatorStr
- endif
- i += 1
- while (1)
- endif
-
- return list2
- End
-